home *** CD-ROM | disk | FTP | other *** search
/ F1 Licenseware / F1 Licenseware - Volume 1.iso / disks / 049b.dms / 049b.adf / MORE_SOURCE_CODE / Anagram_Challenge.AMOS / Anagram_Challenge.amosSourceCode
AMOS Source Code  |  1992-02-26  |  2KB  |  58 lines

  1. 'Anagram Challenge 
  2. 'By Thomas Lancaster 
  3. '
  4. '
  5. CHALLENGE
  6. Procedure CHALLENGE
  7.    Cls 0 : Paper 0 : Pen 2
  8.    Print " "
  9.    NO_OF_WORDS=40 : MOST_LENGTH=1 : SCORE=0 : GOES=0
  10.    Dim WORD$(NO_OF_WORDS)
  11.    For COUNTER=1 To NO_OF_WORDS
  12.       Read WORD$(COUNTER)
  13.       SIZE=Len(WORD$(COUNTER))
  14.       If SIZE>MOST_LENGTH Then MOST_LENGTH=SIZE
  15.    Next COUNTER
  16.    Dim USED(MOST_LENGTH)
  17.    Repeat 
  18.       For COUNT=1 To SIZE
  19.          USED(COUNT)=0
  20.       Next COUNT
  21.       WORD=Rnd(NO_OF_WORDS-1)+1
  22.       SIZE=Len(WORD$(WORD))
  23.       Print 
  24.       NEW_WORD$=""
  25.       For COUNT=1 To SIZE
  26.          Repeat 
  27.             LETTER=Rnd(SIZE-1)+1
  28.          Until USED(LETTER)=0
  29.          USED(LETTER)=1
  30.          LETTER$=Mid$(WORD$(WORD),LETTER,1)
  31.          NEW_WORD$=NEW_WORD$+LETTER$
  32.       Next COUNT
  33.       Print "Find an anagram of ";NEW_WORD$
  34.       Input GUESS$
  35.       If GUESS$=WORD$(WORD)
  36.          Print "Correct"
  37.          SCORE=SCORE+1
  38.       Else 
  39.          Print "Incorrect"
  40.          Print "The correct answer was ";WORD$(WORD)
  41.       End If 
  42.       GOES=GOES+1
  43.       Wait 50
  44.    Until GOES=10
  45.    Print 
  46.    Print "You scored ";SCORE;" out of 10 correct."
  47.    If SCORE=10 Then Print "Perfect. Well done!"
  48.    Wait 50
  49.    End 
  50.    Data "Greetings","Challenge","Banana","Hunted","Twelve"
  51.    Data "Animal","Green","Leopard","Yellow","Youthfulness"
  52.    Data "Mouse","Keyboard","Control","Theatre","Warmth"
  53.    Data "Shallow","Shell","Grapefruit","Teacher","Cards"
  54.    Data "Worry","Grumble","Reduce","Cover","Escape"
  55.    Data "View","Street","Saviour","Schematic","Train"
  56.    Data "Wasp","Necklace","Young","Broken","Silent"
  57.    Data "Living","Elephant","Minus","Torn","Taught"
  58. End Proc